package interface1;


import abstract1.Shape;

public interface Plane2D {
    int getArea();
}

class Rectangle extends Shape implements Plane2D{
   private int width;
   private int height;

    @Override
    public String toString() {
        return "Rectangle(width:" + width + ", height:" + height + ")";
    }

    @Override
    public void draw() {
        for (int i = 0; i <height ; i++) {
            for (int j = 0; j <width ; j++) {
                System.out.print("*");
            }
            System.out.println();
        }

    }

    @Override
    public int getArea() {
        return width*height;
    }
}

class Parallelogram extends Shape implements Plane2D{
    private int width;
    private int height;

    public Parallelogram(int width,int height){
        this.height=height;
        this.width=width;
    }
    public String toString(){
        return "Parallelogram(width:"+width+",height:"+height+")";
    }
    public void draw(){
        for (int i = 1; i <=height ; i++) {
            for (int j = 1; j <=height-i ; j++)
                System.out.print(' ');
                for (int j = 1; j <=width ; j++)
                    System.out.println("#");

            System.out.println();

        }

    }
    public int getArea(){
        return width*height;
    }

}
